import * as echarts from "../../components/ec-canvas/echarts.min"
function initChart(canvas, width, height, dpr) {
  const chart = echarts.init(canvas, null, {
    width: width,
    height: height,
    devicePixelRatio: dpr
  });
  canvas.setChart(chart);
 
  var option = {
    radar: {
      indicator: [
        { name: '专业知识广度', max: 5, color: '#000000' },
        { name: '问题分析能力', max: 5, color: '#000000' },
        { name: '实战经验', max: 5, color: '#000000' },
        { name: '细节把控能力', max: 5, color: '#000000' },
        { name: '应急响应思维', max: 5, color: '#000000' }
      ],
      axisName: {
        color: '#000000'
      },
      splitArea: {
        areaStyle: {
          color: ['rgba(200, 200, 200, 0.3)']
        }
      }
    },
    series: [{
      type: 'radar',
      data: [{
        value: [
          Math.random() * 1.9 + 3, // 3-4.9之间的随机值
          Math.random() * 1.9 + 3,
          Math.random() * 1.9 + 3,
          Math.random() * 1.9 + 3,
          Math.random() * 1.9 + 3
        ],
        name: '能力评估',
        areaStyle: {
          color: 'rgba(0, 100, 255, 0.4)'
        },
        lineStyle: {
          width: 2,
          color: 'rgba(0, 100, 255, 0.8)'
        }
      }]
    }]
  };
  chart.setOption(option);
 
  return chart;
}

Page({
  data: {
    // 用于存储雷达图数据和报告内容数据
    radarChartData: [],
    reportContent: '',
    ec: {
      onInit: initChart
    },
  },

  onLoad: function () {

  },

  
})
